<template>
	<view class="content" v-if="info.id">
		<u-navbar bgColor="#fff" :placeholder="true" :fixed="true" @leftClick="$back" title="查看详情" titleStyle="{'color': '#000'}" v-if="!isScroll">
			
		</u-navbar>
		<u-navbar bgColor="#fff" :placeholder="true" :fixed="true" @leftClick="$back" v-if="isScroll">
			<view slot="center">
				<view class="display-flex avatar-box">
					<image :src="info.user.pic  | formatImgUrl"  mode="aspectFill"></image>
					<text>{{info.user.username}}</text>
				</view>
			</view>
			<view slot="right">
				<text class="focus-btn focus-btn1" @tap="userLikeUser" v-if="info.is_guan == 0">关注</text>
				<text class="focus-btn focus-btn2" @tap="userLikeUser" v-else>已关注</text>
			</view>
		</u-navbar>
		
		<view class="reason-txt" v-if="info.status == 2">
			{{info.reason_msg?info.reason_msg:'自行下架'}}
		</view>
		
		<view class="taibox" @tap="is_com = true,inputFocus = false">
			<view class="taitop">
				<!-- 举报按钮 -->
				<view class="jubox" style="padding: 10rpx;top: 0;" @click.stop="caozuo(1,info.id,info.is_del,info.uid)">
					<image :src="'/images/ju1.png'  | formatImgUrl"  class="jubox"
						mode=""></image>
				</view>
				<image :src="info.user.pic | formatImgUrl" class="taihead" mode=""
					@click.stop="$go('/pages/my/my?id='+info.user.membe_id)"></image>
					
				<view class="taiyou">
					<view class="yoa">
						<view class="nametxt">
							{{info.user.username}}
						</view>
						
							<image
								:src="$options.filters.formatImgUrl(info.user.writer_level.is_active?info.user.writer_level.level.image:info.user.writer_level.level.hide_img)"
								@click.stop="$go('/pages/user/grade?uid='+info.user.membe_id)" class="jipic" mode=""
								v-if="info.user&&info.user.is_writer">
							</image>	
							
						<image v-if="info.user&&info.user.user_level.is_active"
								:src="$options.filters.formatImgUrl(info.user.user_level.active_day>0?info.user.user_level.level.image:info.user.user_level.level.hide_img)"
								class="biepic" mode="" >
							</image>
					</view>
					<view class="display-flex just-between">
						<view class="baobox">
							<view class="baofen" v-if="info.hot">
								{{$db.get('config').diy_hot_label}}
							</view>
							<view class="baofen" v-if="info.sift">
								{{$db.get('config').diy_sift_label}}
							</view>
							<view class="baofen"  v-if="info.is_hide" style="background: rgba(216, 216, 216, 0.3);color: #999;">
								自己可见
							</view> 
							<view class="baofen2"  v-if="info.is_top">
								置顶内容
							</view>
							<view class="baotime">
								{{info.times}} <text class="ip">{{info.ip_address || ''}}</text>
							</view>
						</view>
						
						<text style="font-size: 12px;color:#999;white-space: nowrap;" @tap="$go('/pages/find/views?aid='+id)" v-if="info.uid == $db.get('userInfo').membe_id">{{info.look_num}}浏览</text>
					</view>
				</view>
			</view>
			<view class="baotitle">
				{{info.title}}
			</view>
			<view class="baotxt">
				<rich-text :nodes="info.row | filterRichText"></rich-text>
			</view>
			
			<block v-if="info.img.length == 1">
				<image :src="item | formatImgUrl" class="fupic" mode="widthFix" v-for="item in info.img"
					@click.stop="$common.previewImage(item,info.img)"></image>
			</block>
			
			<block v-else-if="info.img.length == 2 || info.img.length == 4">
				<view class="doubleImg display-flex">
					<image :src="item | formatImgUrl" mode="aspectFill" v-for="item in info.img"
						@click.stop="$common.previewImage(item,info.img)"></image>
				</view>
			</block>
			
			<block v-else>
				<view class="triImg display-flex">
					<image :src="item | formatImgUrl" mode="aspectFill" v-for="item in info.img"
						@click.stop="$common.previewImage(item,info.img)"></image>
				</view>
			</block>
				
			
			<view class="quanzi" v-if="info.gid">
				<image :src="info.group.img | formatImgUrl" class="quanpic" mode=""></image>
				<view class="quantxt">
					{{info.group.name}}
				</view>
			</view>
			<view class="erbox">
				<view class="rili" v-for="item in info.tags">
					#{{item}}
				</view>
			</view>
		</view>
		<view class="winbox" @tap="is_com = true,inputFocus = false">

			
			<view class="line-top display-flex just-between">
				<view :class="isNav == 1 ? 'act' : ''" @tap="changeNav(1)">
					评论&nbsp;{{info.remark_num}}
				</view>
				<view :class="isNav == 2 ? 'act' : ''" @tap="changeNav(2)">
					点赞&nbsp;{{info.like_num}}
				</view>
			</view>
			
			<view class="empytView" v-if="!list.total && isNav == 1">
				<image :src="'/images/kong.png' | formatImgUrl" mode="widthFix" />
				<!-- <view>- 快来抢一楼沙发 -</view> -->
			</view>
			
			<view class="winli" v-for="(item , index) in commentList" :key="index" v-if="item.user && isNav == 1">
				<image :src="item.user.pic | formatImgUrl" class="headpic" mode="" @click.stop="$go('/pages/my/my?id='+item.user.membe_id)"></image>
				<view class="jubox" style="padding: 10rpx;top: 0;" @click.stop="caozuo(2,item.id,1,item.uid)">
					<image :src="'/images/ju1.png' | formatImgUrl"    class="jubox" mode=""></image>
				</view>
				
				<view class="winyou">
					
					<view class="wintop">
						<view class="nametxt">
							{{item.user.username}}
						</view>
						
					<!-- <image
						:src="$options.filters.formatImgUrl(item.user.writer_level.is_active?item.user.writer_level.level.image:item.user.writer_level.level.hide_img)"
						@click.stop="$go('/pages/user/grade?uid='+item.user.membe_id)" class="jipic" mode=""
						v-if="item.user&&item.user.is_writer">
					</image>	
						<image
								v-if="item.user.user_level.is_active"
								:src="$options.filters.formatImgUrl(item.user.user_level.level.image)"
								class="biepic" mode="" >
							</image> -->
						
					
					<!-- 	<image v-if="item.user.user_level.is_active == true"
							
							:src="!item.user.user_level.level?'':($options.filters.formatImgUrl(item.user.user_level.is_active?item.user_level.level.image:item.user_level.level.hide_img))"
							class="biepic" mode="" >
						</image> -->
						
						<view class="pusher" v-if="item.uid == info.uid">
							发布者
						</view>
					</view>
					
					<view class="fuben"  @click.stop="toMsg(item)">
						<rich-text :nodes="item.row"></rich-text>
					</view>
					<view class="windi"  @click.stop="toMsg(item)">
						<view class="wintime">
							{{item.times}} <text class="ip">{{item.ip_address || ''}}</text>
						</view>
						<view style="display: flex;justify-content: center;align-items: center;">
							<!-- <view style="padding: 0 16rpx;">
								<u-icon name="chat" color="#999999" size="20"></u-icon>
							</view> -->
							
							<view class="zabox" @tap.stop="userLike(2,item.id,3,item)">
								<image :src="(item.is_like==true?'/images/zz1.png': '/images/zz.png') | formatImgUrl"
									class="zapic" style="width: 36rpx;height: 36rpx;">
								<view class="zatxt" :class="{zaactive:item.is_like}">
									{{item.like_num || '点赞'}}
								</view>
							</view>
						</view>
					
					</view>
					<view class="huifu"  v-if="item.com_num || item.reply_num">
						<view class="display-flex" style="align-items: flex-start;">
							<image :src="item.childen_list.pic | formatImgUrl" class="huifu-avatar" mode="aspectFill" @click.stop="$go('/pages/my/my?id='+item.user.membe_id)"></image>
							<image :src="'/images/ju1.png' | formatImgUrl"  class="jubao" mode="" @click.stop="caozuo(2,item.childen_list.id,1,item.childen_list.uid)"></image>
							<view class="">
								<view class="huifu-user" @click.stop="toMsg(item)" style="padding-left: 8px;box-sizing:border-box;">
									<text>{{item.childen_list.username}}</text><text v-if="item.childen_list.uid == info.uid" class="pusher" style="white-space: nowrap;font-size: 10px;text-align:center;line-height: 15px;color: #45C4B0;">发布者</text>
								</view>
								<view class="display-flex" style="margin-top: -10rpx;padding-left: 8px;box-sizing:border-box;">
									{{item.childen_list.row}}
								</view>
								
								<view class="windi display-flex"  @click.stop="toMsg(item)" style="width: 535rpx;padding-left: 8px;box-sizing:border-box;">
									<view class="wintime">
										{{item.childen_list.times}} <text class="ip">{{item.ip_address || ''}}</text>
									</view>
									<view style="display: flex;justify-content: center;align-items: center;">
										<view class="zabox" @tap.stop="userLikeNew2(2,item.childen_list.id,3,item)">
											<image :src="(item.childen_list.is_like==true?'/images/zz1.png': '/images/zz.png') | formatImgUrl"
												class="zapic" style="width: 36rpx;height: 36rpx;">
											<view class="zatxt" :class="{zaactive:item.childen_list.is_like}">
												{{item.childen_list.like_num || '点赞'}}
											</view>
										</view>
									</view>
								
								</view>
							</view>
						</view>
						
						<view class="huifu-total" v-if="item.com_num > 1 || item.reply_num > 1" @tap="showComment=true,pid=item.id,openComment(item.id)">
							展开{{item.com_num}}条回复
						</view>
						<!-- <view class="huifu-total" v-if="item.reply_num > 1">
							收起全部回复>
						</view> -->
					</view>
					
				</view>
			</view>
			<view class="empytView" style="padding-bottom: 60rpx;" v-if="!likes.total && isNav == 2">
				<image :src="'/images/kong.png' | formatImgUrl" mode="widthFix" />
			</view>
			
			<view class="winli" v-for="(item , index) in likeList" :key="index" v-if="item.user && isNav == 2">
				<image :src="item.user.pic | formatImgUrl" class="headpic" mode="" @click.stop="$go('/pages/my/my?id='+item.user.membe_id)"></image>
				<view class="winyou">
					
					<view class="wintop">
						<view class="nametxt">
							{{item.user.username}}
						</view>
						
					<image
						:src="$options.filters.formatImgUrl(item.user.writer_level.is_active?item.user.writer_level.level.image:item.user.writer_level.level.hide_img)"
						@click.stop="$go('/pages/user/grade?uid='+item.user.membe_id)" class="jipic" mode=""
						v-if="item.user&&item.user.is_writer">
					</image>	
						<!-- {{item.user.user_level.level.image}} -->
						<image
								v-if="item.user.user_level.is_active"
								:src="$options.filters.formatImgUrl(item.user.user_level.level.image)"
								class="biepic" mode="" >
							</image>
						
					
					<!-- 	<image v-if="item.user.user_level.is_active == true"
							
							:src="!item.user.user_level.level?'':($options.filters.formatImgUrl(item.user.user_level.is_active?item.user_level.level.image:item.user_level.level.hide_img))"
							class="biepic" mode="" >
						</image> -->
						
					</view>
					
					<view class="fuben">
						<text style="font-size: 10px;color: #999;">{{item.user.signature_des || '这个用户很神秘，什么都没有留下'}}</text>
					</view>
				</view>
			</view>
		</view>
		<view class="mask-pop" style="position: fixed;top: 0;left: 0;width: 100%;height: 100vh;background-color: rgba(0,0,0,0);" @touchmove.stop.prevent="()=>{}" v-if="softHeight">
			
		</view>
		
		<view v-if="is_com==false" class="pjbox" :style="{'padding-bottom': softHeight ? 0 : paddingBottomHeight + 'rpx','bottom' : softHeight ?  softHeight - 35 + 'px' : 0,'position': softHeight ? 'absolute' : 'fixed'}">
			<view class="display-flex reply-box">
				<!-- <view v-if="toMsgInfo" class="to-msg" @click.stop="delMsg">
					<text class="oneline">回复@{{toMsgInfo.user.username}}:</text>
				</view> -->
				<!-- <input type="text" :adjust-position="false"  v-model="inputValue" @input="handleInputChange" :focus="inputFocus" class="phput" :placeholder="toMsgInfo?holder:'说点想说的...'"> -->
				<textarea type="text" :adjust-position="false" :auto-height="true" v-model="inputValue" @input="handleInputChange" :focus="inputFocus" class="phput" :placeholder="toMsgInfo?holder:'说点想说的...'" />
			</view>
			
			<view class="fa-btn" @click="addComment">
				发送
			</view>
		</view>
		
		<view v-if="is_com==true" class="pjbox" :style="{'padding-bottom': paddingBottomHeight + 'rpx'}">
			<view  class="zan display-flex" @click.stop="userLike(1,info.id,2,info)">
				<image :src="(info.is_like==true?'/images/zz1.png': '/images/zz.png') | formatImgUrl"  mode=""></image>
				<view>点赞</view>
				<!-- <text>（{{info.like_num}}）</text> -->
			</view>
			<view class="line">
				
			</view>
			<view class="com display-flex" @click.stop="ping(1)">
				<image src="/static/images/tc.png" mode=""></image>
				<view>评论</view>
				<!-- <text>（{{info.remark_num}}）</text> -->
			</view>
		</view>
		
		
		<view class="pjbox1" :style="{'padding-bottom': paddingBottomHeight + 'rpx'}" v-if="info.status==2">
			<view  @click.stop="shanchu(1)">删除内容</view>
			<view  @click.stop="edits()">再次编辑</view>
		</view>
		
		<!-- 举报弹框 -->
		<u-popup :show="show" @close="show=false" zIndex="99999">
			<view class="mask">
				<!-- 10.16新增 -->
				<block v-if="type == 1 && info.status != 2">
					<view class="matop" @click.stop="is_tops(0)" v-if="info.user.membe_id == $db.get('userInfo').membe_id && is_hide==0">
						<view class="matxt">
							<text v-if="is_top==0">置顶</text>
							<text v-if="is_top==1">取消置顶</text>
						</view>
						<image :src="'/images/rarr.png'  | formatImgUrl" class="mapic" mode=""></image>
					</view>
					<view class="matop" :style="{'margin-top': is_hide==0 ? '-10px' : '0'}" @click.stop="is_tops(1)" v-if="info.user.membe_id == $db.get('userInfo').membe_id">
						<view class="matxt">
							<text v-if="is_hide==0">设为隐私</text>
							<text v-if="is_hide==1">设为公开</text>
						</view>
						<image :src="'/images/rarr.png'  | formatImgUrl" class="mapic" mode=""></image>
					</view>
					<view class="matop" style="margin-top: -10px;" @click.stop="is_tops(2)" v-if="info.user.membe_id == $db.get('userInfo').membe_id&& is_hide==0">
						<view class="matxt">
							<text v-if="lw==0">设为例文</text>
							<text v-if="lw==1">取消例文</text>
						</view>
						<image :src="'/images/rarr.png'  | formatImgUrl" class="mapic" mode=""></image>
					</view>
					
					
				</block>
				
				<view class="matop" :style="{'margin-top': type == 1 && info.status != 2 ? '-10px' : '0'}"  @click="goToedit()" v-if="info.user.membe_id == $db.get('userInfo').membe_id">
					<view class="matxt">
						编辑
					</view>
					<image :src="'/images/rarr.png' | formatImgUrl" class="mapic" mode=""></image>
				</view>
				<view class="matop" style="margin-top: -10px;"  @click.stop="is_tops(3)" v-if="info.user.membe_id == $db.get('userInfo').membe_id && type == 1">
					<view class="matxt">
						<text v-if="status==1">下架</text>
						<text v-if="status==2">上架</text>
					</view>
					<image :src="'/images/rarr.png'  | formatImgUrl" class="mapic" mode=""></image>
				</view>
				
				<view class="matop" :style="{'margin-top': info.user.membe_id == $db.get('userInfo').membe_id ? '-10px' : '0'}" @click.stop="goToreport" v-if="membe_id != $db.get('userInfo').membe_id">
					<!-- <image :src="'/images/jing.png'  | formatImgUrl" class="mapic" mode=""></image> -->
					<view class="matxt">
						举报
					</view>
					<image :src="'/images/rarr.png'  | formatImgUrl" class="mapic" mode=""></image>
				</view>
				
				<view  class="matop" :style="{'margin-top':( membe_id == $db.get('userInfo').membe_id || info.user.membe_id == $db.get('userInfo').membe_id) && type == 1 ? '-10px' : '0'}" v-if="membe_id == $db.get('userInfo').membe_id || info.user.membe_id == $db.get('userInfo').membe_id">
					<!-- <image :src="'/images/jing.png'  | formatImgUrl" class="mapic" mode=""></image> -->
					<view class="matxt" @click.stop="show=false,showConfirm=true">
						删除
					</view>
					<image :src="'/images/rarr.png'  | formatImgUrl" class="mapic" mode=""></image>
				</view>
				
				<view class="qubox" @click.stop="show = false">
					取消
				</view>
			</view>
		</u-popup>
		
		
		<u-popup mode="center" :show="showConfirm" zIndex="99999" @close="showConfirm=false">
			<view class="mask11" style="padding-left: 0;padding-right: 0;padding-bottom: 0;">
				<view class="matitle">
					<text>确认删除？</text>
				</view>
				<view class="matxt">
					此操作不可逆
				</view>
				<view class="quque">
					<view class="quli" @click="showConfirm = false">
						取消
					</view>
					<view class="quli quactive" @click="showConfirm = false,shanchu()">
						确定
					</view>
				</view>
			</view>
		</u-popup>
	
		<u-popup :show="showComment" @close="showComment=false">
			<view class="comment-tips-box">
				<view class="display-flex comment-tips-top just-between">
					<text>查看全部评论</text>
					<image :src="'/images/comment-close.png' | formatImgUrl" mode="aspectFit" @tap="showComment=false"/>
				</view>
				<scroll-view scroll-y="true" class="comment-tips">
					<view class="winli" v-for="(item , index) in sonList" :key="index">
						<image :src="item.pic | formatImgUrl" class="headpic" mode="" @click.stop="$go('/pages/my/my?id='+item.uid)"></image>
						<view class="jubox" style="padding: 10rpx;top: 0;" @click.stop="caozuo(2,item.id,item.is_del,item.uid)">
							<image :src="'/images/ju1.png' | formatImgUrl"    class="jubox" mode=""></image>
						</view>
						
						<view class="winyou">
							
							<view class="wintop">
								<view class="nametxt">
									{{item.username}}
								</view>
								
								<view class="pusher" v-if="item.uid == info.uid">
									发布者
								</view>
							</view>
							
							<view class="fuben fuben-user"  @click.stop="toMsg(item)">
								<block v-if="item.level > 1">回复 <text>{{item.huifu.username}}</text> :</block>{{item.row}}
							</view>
							<view class="windi"  @click.stop="toMsg(item)">
								<view class="wintime">
									{{item.show_time}} <text class="ip">{{item.ip_address || ''}}</text>
								</view>
								<view style="display: flex;justify-content: center;align-items: center;">
									
									<view class="zabox" @tap.stop="userLikeNew(2,item.id,3,item)">
										<image :src="(item.is_like==true?'/images/zz1.png': '/images/zz.png') | formatImgUrl"
											class="zapic" style="width: 36rpx;height: 36rpx;">
										<view class="zatxt" :class="{zaactive:item.is_like}">
											{{item.like_num || '点赞'}}
										</view>
									</view>
								</view>
					
							</view>
						</view>
					</view>
				</scroll-view>
				
				<view v-if="is_com==false" class="pjbox" :style="{'padding-bottom': softHeight ? 0 : paddingBottomHeight + 'rpx','bottom' : softHeight ?  softHeight - 35 + 'px' : 0,'position': softHeight ? 'absolute' : 'fixed'}">
					<view class="display-flex reply-box">
						<!-- <input type="text" v-model="inputValue" @input="handleInputChange" :focus="inputFocus" class="phput" :placeholder="toMsgInfo?holder:'说点想说的...'"> -->
						<textarea type="text" :adjust-position="false" :auto-height="true" v-model="inputValue" @input="handleInputChange" :focus="inputFocus" class="phput" :placeholder="toMsgInfo?holder:'说点想说的...'" />
					</view>
					
					<view class="fa-btn" @click="addCommentNew">
						发送
					</view>
				</view>
			</view>
		</u-popup>
		
		<u-popup :show="onlike" mode="center" overlayOpacity="0">
			<image class="likeicon zwyShake" style="transform-origin: center bottom;" src="/static/images/star11.png"></image>
		</u-popup>
	</view>
</template>
<script>
	import * as db from '@/common/db.js'
	var Screen = uni.requireNativePlugin('Yam-Screen');
	
	export default {
		data() {
			return {
				onlike: false,
				holder: '回复评论',
				id: '',
				info: {},
				// 举报弹框
				is_del:0,
				show: false,
				//苹果X以上手机底部适配高度
				paddingBottomHeight: 0,
				// 评论输入
				dian: false,
				txtea: false,
				inputValue: '', // 输入框的值
				showElement: true, // 是否展示元素
				page: 1,
				list: {},
				commentList: [],
				toMsgInfo: {},
				inputFocus:false,
				is_com:true,
				
				is_top:0,
				is_hide:0,
				lw:0,
				status: 0,
				type: '',
				
				isNav: 1,
				likes: {},
				likeList: [],
				membe_id: '',
				showConfirm: false,
				sonList: [],
				showComment: false,
				isScroll: false,
				pid: '',
				softHeight: 0
			}
		},
		onHide() {
			// #ifdef APP-PLUS
					setTimeout(()=>{
						Screen.closeAntiRecordScreen();
					},100)
			// #endif
		},
		onUnload() {
		
			// #ifdef APP-PLUS
					Screen.closeAntiRecordScreen();
			// #endif
		},
		onLoad(e) {
			uni.onKeyboardHeightChange(res => {
			  this.softHeight = res.height
			})
			
			if (e.id) {
				this.id = e.id
				this.getInfo()
				console.log(7777777)
				this.getComment()
			} else {
				this.$common.errorToShow('参数异常')
			}
		},
		onPageScroll(e) {
			if(e.scrollTop > 100){
				this.isScroll = true
			}else{
				this.isScroll = false
			}
		},
		created() {
			let that = this;
			uni.getSystemInfo({
				success: function(res) {
					let model = ['X', 'XR', 'XS', '11', '12', '13', '14', '15'];
					model.forEach(item => {
						//适配iphoneX以上的底部，给tabbar一定高度的padding-bottom
						if (res.model.indexOf(item) != -1 && res.model.indexOf('iPhone') != -1) {
							// that.paddingBottomHeight = 40;
						}
					})
				}
			});
			var url = getCurrentPages()
			this.urlPath = '/' + url[0].route

		},
		// 上拉加载
		onReachBottom() {
			if(this.isNav == 1){
				if (this.list.current_page < this.list.last_page) {
					this.page++; // 页数加一，加载下一页数据
					this.getComment();
				}
			}
			
			if(this.isNav == 1){
				if (this.likes.current_page < this.likes.last_page) {
					this.page++; // 页数加一，加载下一页数据
					this.getLikeList();
				}
			}
		},
		methods: {
			openComment(pid){
				this.$api.default.request('index/getListComDea', {
					pid: this.pid,
				}, 'POST').then((res) => {
					if (res.code == 1) {
						this.sonList = res.data
					}
				})
			},
			// 关注
			userLikeUser(){
				let auth = db.get('auth');
				if (!auth) {
					uni.navigateTo({
				
						url: '/pages/login/login'
				
					})
					return;
				}
				
				this.$api.default.request('user/userLike', {
					uid: this.info.uid,
				}, 'POST').then((res) => {
					if (res.code == 1) {
						let msg = this.info.is_guan == 1 ? '取消成功' : '关注成功'
						this.$common.successToShow(msg,()=>{
							this.getInfo()
						})
					}
				})
			},
			goToedit(item) {
				this.show = false
				uni.navigateTo({
					url: '/pages/finance/fabu?item=' + encodeURIComponent(JSON.stringify(this.info))
				})
			},
			getLikeList() {
				this.$api.default.request('Discover/getLikeList', {
					id: this.id,
					page: this.page
				}, 'POST', false).then((res) => {
					if (res.code) {
						this.likes = res.data
						if (res.data.current_page > 1) {
							res.data.data.forEach((item) => {
								this.likeList.push(item)
							})
						} else {
							this.likeList = res.data.data
						}
					}
				})
			},
			changeNav(num){
				this.isNav = num
				
				this.page = 1
				if(this.isNav == 1){
					this.getComment();
				}
				if(this.isNav == 2){
					this.getLikeList();
				}
			},
			// 动态设置操作
			is_tops(type){
				this.show=false
				this.$api.default.request('user/user_top', {
					id: this.aid,
					type: type
				}, 'POST').then((res) => {
					if (res.code == 1) {
						this.$common.successToShow(res.msg,()=>{
							this.getInfo()
							this.showdel = false
							
							
						})
					}
				})
			},
			ping(e){
				console.log(1110)
				this.is_com = false
				this.inputFocus = true
			},
			caozuo(type,aid,is_del,uid){
				
				
				this.type = type
				this.aid = aid
				this.is_del = is_del
				this.show = true
				this.membe_id = uid
		
				// if(this.type == 2){
				// 	this.is_del = is_del
				// }
				
					
			},
			edits(){
				uni.navigateTo({
					url: '/pages/finance/fabu?item=' + encodeURIComponent(JSON.stringify(this.info))
				})
			},
			shanchu(){
				var flag = this.type;
				
				this.show = false
				let _this = this;
				
				console.log(_this.type);
				if(_this.type == 1){
					//帖子
					if(flag == 1){
						_this.$api.default.request('discover/rowOperate', {
							id: _this.info.id,
							type: 2
						}).then((res) => {
							if (res.code) {
									uni.navigateBack({
									  delta: 1
									})
							
							}
						})
					}else{
						_this.$api.default.request('discover/rowOperate1', {
							id: _this.aid,
							type: 2
						}).then((res) => {
							if (res.code) {
									uni.navigateBack({
									  delta: 1
									})
							
							}
						})
					}
					
				}else{
					//评价
					_this.$api.default.request('discover/rowOperateOper', {
						id: _this.aid,
						type: 2
					}).then((res) => {
						if (res.code) {
							_this.showComment = false
							_this.getInfo()
							
							_this.page = 1; // 页数加一，加载下一页数据
							_this.commentList = [];
							_this.getComment();
						}
					})
				}
				
				// uni.showModal({
				// 	// cancelText: '取消',
				// 	// confirmText: '确定',
				// 	confirmColor: '#45C4B0',
				// 	content: '是否确定删除内容',
				// 	success: function(res) {
				// 		if (res.confirm) {
				// 				console.log(_this.info.id,77777777777)
						
				// 				if(_this.type == 1){
				// 					//帖子
				// 					if(flag == 1){
				// 						_this.$api.default.request('discover/rowOperate', {
				// 							id: _this.info.id,
				// 							type: 2
				// 						}).then((res) => {
				// 							if (res.code) {
				// 									uni.navigateBack({
				// 									  delta: 1
				// 									})
											
				// 							}
				// 						})
				// 					}else{
				// 						_this.$api.default.request('discover/rowOperate1', {
				// 							id: _this.aid,
				// 							type: 2
				// 						}).then((res) => {
				// 							if (res.code) {
				// 									uni.navigateBack({
				// 									  delta: 1
				// 									})
											
				// 							}
				// 						})
				// 					}
									
				// 				}else{
				// 					//评价
				// 					_this.$api.default.request('discover/rowOperateOper', {
				// 						id: _this.aid,
				// 						type: 2
				// 					}).then((res) => {
				// 						if (res.code) {
				// 							_this.getInfo()
											
				// 							_this.page = 1; // 页数加一，加载下一页数据
				// 							_this.commentList = [];
				// 							_this.getComment();
				// 						}
				// 					})
				// 				}
						
				// 		} else if (res.cancel) {
							
				// 		}
				// 	}
				// })
				
			},
			toMsg(item) {
				this.is_com = false
				this.toMsgInfo = item
				this.inputFocus = true
				
				this.holder =  "回复@" + this.toMsgInfo.user.username
			},
			delMsg() {
				this.toMsgInfo = ''
				this.inputFocus = false
			},
			userLike(type = 1, id,is_msg,item) {
				
				let auth = db.get('auth');
				console.log(auth,777777777)
				//用户存在，不跳转，不存在直接跳转
				if (!auth) {
					// toLogin()
					uni.navigateTo({
						url: '/pages/login/login'
					})
					return;
				}
				
				if(!item.is_like){
					this.onlike = true
				}
				this.$api.default.request('user/likeArticle', {
					id: id,
					type: type,
					is_msg: is_msg //0回复发布的内容 1回复评价 2内容点赞 3评价的点赞
				}, 'POST', false).then((res) => {
					setTimeout(()=> {
						this.onlike = false
					}, 1000);
					
					if (res.code) {
						this.page = 1
						this.getInfo()
						this.getComment()
					}
				})
			},
			userLikeNew(type = 1, id,is_msg,item){
				let auth = db.get('auth');
				if (!auth) {
					// toLogin()
					uni.navigateTo({
				
						url: '/pages/login/login'
				
					})
					return;
				}
				
				if(!item.is_like){
					this.onlike = true
				}
				this.$api.default.request('user/likeArticle', {
					id: id,
					type: type,
					is_msg: is_msg //0回复发布的内容 1回复评价 2内容点赞 3评价的点赞
				}, 'POST', false).then((res) => {
					setTimeout(()=> {
						this.onlike = false
					}, 1000);
					
					if (res.code) {
						item.is_like = !item.is_like
						if(item.is_like){
							item.like_num++
						}else{
							item.like_num--
						}
						this.$forceUpdate()
					}
				})
			},
			userLikeNew2(type = 1, id,is_msg,item){
				let auth = db.get('auth');
				if (!auth) {
					// toLogin()
					uni.navigateTo({
				
						url: '/pages/login/login'
				
					})
					return;
				}
				
				if(!item.childen_list.is_like){
					this.onlike = true
				}
				this.$api.default.request('user/likeArticle', {
					id: id,
					type: type,
					is_msg: is_msg //0回复发布的内容 1回复评价 2内容点赞 3评价的点赞
				}, 'POST', false).then((res) => {
					setTimeout(()=> {
						this.onlike = false
					}, 1000);
					
					if (res.code) {
						item.childen_list.is_like = !item.childen_list.is_like
						if(item.childen_list.is_like){
							item.childen_list.like_num++
						}else{
							item.childen_list.like_num--
						}
						
						this.getInfo()
						this.getComment()
						this.$forceUpdate()
					}
				})
			},
			getInfo() {
				
				console.log(111111111)
			
				this.$api.default.request('Discover/articleInfo', {
					id: this.id
				}, 'POST', false).then((res) => {
					if (res.code) {
						this.info = res.data
						
						this.is_top=res.data.is_top
						this.is_hide=res.data.is_hide
						this.lw=res.data.lw
						this.status=res.data.status
						if(this.lw ==1){
							// #ifdef APP-PLUS
									Screen.openAntiRecordScreen();
							// #endif
							
						}
						
					}
				})
			},
			getComment() {
				this.$api.default.request('Discover/getComment', {
					id: this.id,
					page: this.page
				}, 'POST', false).then((res) => {
					if (res.code) {
						this.list = res.data
						if (res.data.current_page > 1) {
							res.data.data.forEach((item) => {
								this.commentList.push(item)
							})
						} else {
							this.commentList = res.data.data
						}
					}
				})
			},
			addComment() {
				let auth = db.get('auth');
				console.log(auth,777777777)
				//用户存在，不跳转，不存在直接跳转
				if (!auth) {
					// toLogin()
					uni.navigateTo({
						url: '/pages/login/login'
					})
					return;
				}
				
				if(!this.inputValue){
					this.$common.errorToShow('发送的消息不能为空噢')
					return
				}
				
				var prams = {
					aid: this.info.id,
					row: this.inputValue,
					is_msg: 1 //0回复发布的内容 1回复评价 2内容点赞 3评价的点赞
				}
				if (this.toMsgInfo) {
					prams['pid'] = this.toMsgInfo.id
				}
				this.$api.default.request('Discover/addComment', prams, 'POST').then((res) => {
					if (res.code) {
						this.inputValue = ''
						this.toMsgInfo = ''
						this.inputFocus = false
						this.is_com = true
						this.getComment()
					}
				})
			},
			addCommentNew(){
				let auth = db.get('auth');
				console.log(auth,777777777)
				//用户存在，不跳转，不存在直接跳转
				if (!auth) {
					// toLogin()
					uni.navigateTo({
				
						url: '/pages/login/login'
				
					})
					return;
				}
				
				if(!this.inputValue){
					this.$common.errorToShow('发送的消息不能为空噢')
					return
				}
				
				var prams = {
					aid: this.info.id,
					row: this.inputValue,
					is_msg: 1 //0回复发布的内容 1回复评价 2内容点赞 3评价的点赞
				}
				if (this.toMsgInfo) {
					prams['pid'] = this.toMsgInfo.id
				}
				this.$api.default.request('Discover/addComment', prams, 'POST').then((res) => {
					if (res.code) {
						this.inputValue = ''
						this.toMsgInfo = ''
						this.inputFocus = false
						this.is_com = true
						this.openComment(this.toMsgInfo.id)
					}
				})
			},
			// 评论输入
			handleInputChange() {
				if (this.inputValue) {
					this.showElement = false // 有值时展示元素
				} else {
					this.showElement = true // 没有值时隐藏元素
				}
			},
			zanTab() {
				this.dian = !this.dian
				this.txtea = !this.txtea
			},
			close() {
				this.show = false
			},
			goToreport() {
				this.show = false
				
				let newtype = this.type == 1 ? 3 : 4
				uni.navigateTo({
					url: '/pages/find/report?id=' + this.aid + '&type=' + this.type + '&newtype=' + newtype
				})
			}
		}
	}
</script>

<style lang="scss">
	.likeicon{
		display: block;
		margin: 0 auto;
		width: 80rpx;height: 80rpx;
	}
	.comment-tips-box{
		padding: 10px 15px;
		padding-top: 15px;
		box-sizing: border-box;
		background-color: #fff;
		height: 521px;
		border-radius: 16rpx 16rpx 0 0;
	}
	
	.comment-tips-top{
		font-family: Source Han Sans;
		font-size: 14px;
		font-weight: bold;
		color: #3D3D3D;
		margin-bottom: 5px;
		
		image{
			width: 20px;
			height: 20px;
		}
	}
	
	.comment-tips{
		height: 470px;
	}
	
	.avatar-box{
		width: 560rpx;
		justify-content: flex-start;
		
		image{
			width: 30px;
			height: 30px;
			border-radius: 50%;
		}
		
		text{
			margin-left: 4px;
			font-family: 思源黑体;
			font-size: 14px;
			color: #3D3D3D;
		}
	}
	
	.focus-btn{
		display: inline-block;
		width: 51px;
		height: 20px;
		line-height: 20px;
		text-align: center;
		border-radius: 94px;
		font-family: Source Han Sans;
		font-size: 10px;
	}
	
	.focus-btn1{
		background: rgba(#45C4B0,.15);
		color: #45C4B0;
	}
	
	.focus-btn2{
		background: rgba(153, 153, 153, 0.1);
		color: #999;
	}
	
	.reason-txt{
		padding: 12rpx;
		text-align: center;
		font-family: '思源黑体';
		font-size: 12px;
		color: #999999;
	}
	
	page {
		background: rgba(242, 245, 242, 1);
	}

	.content {
		.line-top{
			width: 100%;
			padding-top: 10px;
			padding-bottom:10rpx;
			background-color: #ffffff;
			font-size: 16px;
			height: 30px;
			line-height: 30px;
			border-bottom: 1px solid rgba(153, 153, 153, 0.1);
			view{
				color: #999;
				font-size: 14px;
				font-weight: 400;
			}
			
			.act{
				color: #3d3d3d;
				font-weight: 700;
			}
		}
		
		.taibox {
			padding: 20rpx 30rpx 4rpx;
			background-color: #ffffff;
			margin-bottom: 20rpx;

			.taitop {
				display: flex;
				align-items: center;
				padding-bottom: 4rpx;
				position: relative;

				.jubox {
					position: absolute;
					top: 6rpx;
					right: 0rpx;
					width: 32rpx;
					height: 32rpx;
					// border: 1px dashed #eeeeee;
				}

				.taihead {
					width: 80rpx;
					height: 80rpx;
					border-radius: 50%;
					flex-shrink: 0;
				}

				.taiyou {
					padding: 0 12rpx;
					flex: 1;

					.yoa {
						display: flex;
						align-items: center;
						padding-bottom: 8rpx;

						.nametxt {
							font-size: 28rpx;
							color: #3D3D3D;
							padding-right: 8rpx;
							font-weight: bold;
						}

						.jipic {
							width: 41px;
							height:19px;
							margin-left: 4px;
						}

						.biepic {
							width: 41px;
							height:19px;
							margin-left: 4px;
						}
					}

					.baobox {
						display: flex;
						align-items: center;
						flex-wrap: wrap;

						.baofen {
							padding: 2rpx 8rpx;
							background: rgba(243, 122, 165, 0.15);
							border-radius: 4px;
							margin-right: 8rpx;
							flex-shrink: 0;
							font-size: 20rpx;
							letter-spacing: 0.08em;
							color: #F37AA5;
							font-weight: bold;
						}
						.baofen2 {
							padding: 2rpx 8rpx;
							background: rgba(69, 196, 176, 0.07);
							border-radius: 4px;
							margin-right: 8rpx;
							flex-shrink: 0;
							font-size: 20rpx;
							letter-spacing: 0.08em;
							color: #45C4B0;
						}

						.baotime {
							font-size: 24rpx;
							letter-spacing: 0em;
							color: #999999;
						}
						
						text{
							color: #999;
							font-size: 10px;
						}
					}
				}
			}

			.baotitle {
				margin-top: 10px;
				ont-family: '思源黑体';
				font-size: 16px;
				color: #3D3D3D;
				padding-bottom: 6px;
				font-weight: 600;
			}

			.baotxt {
				font-size: 28rpx;
				color: #3D3D3D;
				line-height: 38rpx;
				padding-bottom: 20rpx;
			}

			.fupic {
				width: 100%;
				margin-bottom: 20rpx;
			}
			
			.doubleImg{
				flex-wrap: wrap;
				justify-content: space-between;
				
				image{
					width: 168px;
					height: 168px;
					margin-bottom: 6px;
				}
			}
			
			.triImg{
				flex-wrap: wrap;
				
				image{
					width: 105px;
					height: 106px;
					margin-right: 6px;
					margin-bottom: 6px;
				}
				
				image:nth-of-type(3n){
					margin-right: 0;
				}
			}

			.quanzi {
				display: flex;
				align-items: center;
				flex-wrap: wrap;
				padding-bottom: 20rpx;

				.quanpic {
					width: 46rpx;
					height: 46rpx;
					border-radius: 6px;
				}

				.quantxt {
					font-size: 26rpx;
					font-weight: bold;
					letter-spacing: 0.08em;
					color: #3D3D3D;
					padding-left: 8rpx;
				}
			}

			.erbox {
				display: flex;
				align-items: center;
				flex-wrap: wrap;

				.rili {
					display: inline-block;
					vertical-align: middle;
					// max-width: 180rpx;
					white-space: nowrap;
					// overflow: hidden;
					// text-overflow: ellipsis;
					background: rgba(153, 153, 153, 0.102);
					padding: 2px 8px 2px 6px;
					border-radius: 89px;
					font-family: 思源黑体;
					font-size: 12px;
					font-weight: bold;
					color: #999;
					margin-right: 16rpx;
					margin-bottom: 16rpx;
				}
			}
		}

		.winbox {
			padding: 0 30rpx;
			margin-bottom: 20rpx;
			background-color: #ffffff;

			
		}
		
		.winli {
			display: flex;
			align-items: flex-start;
			padding: 20rpx 0;
			border-bottom: 1px solid rgba(153, 153, 153, 0.1);
			position: relative;
		
			.jubox {
				position: absolute;
				top: 24rpx;
				right: 0rpx;
				width: 32rpx;
				height: 32rpx;
				// border: 1px dashed #eeeeee;
			}
		
			.headpic {
				width: 80rpx;
				height: 80rpx;
				border-radius: 50%;
				flex-shrink: 0;
			}
		
			.winyou {
				flex-grow: 1;
				padding-left: 24rpx;
		
				.wintop {
					display: flex;
					align-items: center;
					padding-bottom: 8rpx;
		
					.nametxt {
						font-size: 24rpx;
						color: #AEAEAE;
						padding-right: 8rpx;
						// font-weight: bold;
					}
		
					.jipic {
						width: 41px;
						height:19px;
						margin-left: 4px;
					}
		
					.biepic {
						width: 41px;
						height:19px;
						margin-left: 4px;
					}
				}
		
				.fuben {
					font-size: 24rpx;
					font-weight: normal;
					letter-spacing: 0em;
					color: #494949;
					line-height: 34rpx;
					// padding-bottom: 5rpx;
				}
				
				.fuben-user{
					font-family: 思源黑体;
					font-size: 12px;
					color: #494949;
					
					text{
						color: #45C4B0;
						margin-left: 2px;
					}
				}
		
				.huifu {
					// height: 52rpx;
					border-radius: 4px;
					margin: 15rpx 0;
					margin-bottom: 0;
					line-height: 52rpx;
					font-size: 24rpx;
					color: #494949;
					position: relative;
					
					.jubao{
						position: absolute;
						right: 0px;
						top: 2px;
						width: 16px;
						height: 16px;
					}
					
					.huifu-avatar{
						width: 30px;
						height: 30px;
						border-radius: 50%;margin-top: 4px;
						margin-right: 4px;
					}
					
					.huifu-user{
						font-family: Source Han Sans CN;
						font-size: 12px;
						color: #AEAEAE;
						padding-top: 0px;
					}
					.huifu-user text{
						display: inline-block;vertical-align: middle;
						font-size: 12px;
						color: #AEAEAE;
					}
					
					.huifu-total{
						padding-left: 42px;
						font-family: Source Han Sans CN;
						font-size: 12px;
						color: #45C4B0;
					}
				}
				
				.wintime {
					font-size: 20rpx;
					font-weight: normal;
					letter-spacing: 0em;
					color: #999999;
					
				}
		
				.windi {
					display: flex;
					align-items: center;
					justify-content: space-between;
					line-height: 22rpx;
					margin-top: -5rpx;
		
					.zabox {
						display: flex;
						align-items: center;
						justify-content: space-between;
		
						.zapic {
							width: 28rpx;
							height: 28rpx;
						}
		
						.zatxt {
							font-size: 20rpx;
							letter-spacing: 0.08em;
							color: #999999;
							padding-left: 2rpx;
						}
		
						.zaactive {
							color: #43DC71;
						}
					}
				}
			}
		}
		
		.pjbox1 {
			width: 100%;
			height: 98rpx;
			background-color: #ffffff;
			display: flex;
			align-items: center;
			justify-content: center;
			position: fixed;
			left: 0;
			bottom: 0;
			
			view{
				float:left;
				width: 40%;
				height:60rpx;
				line-height:60rpx;
				margin: 0 auto;
				text-align: center;
				font-size: 24rpx;
				&:first-child{
					background:rgba(216, 216, 216, 0.3);
					color: #999;
				}
				&:last-child{
					background:rgba(216, 216, 216, 0.3);
					color: #fff;
					background: #45C4B0;
					border-radius: 4px;
				}
			}
			
		}

		.pjbox {
			width: 100%;
			min-height: 98rpx;
			background-color: #ffffff;
			display: flex;
			align-items: center;
			justify-content: space-between;
			position: fixed;
			left: 0;
			bottom: 0;
			z-index: 99;
			padding: 0 15rpx;
			box-sizing: border-box;
			
			.reply-box{
				// margin: 0 25rpx;
				min-height: 72rpx;
				border-radius: 20px;
				background: #F8F8F8;
				padding: 6rpx 24rpx;
				box-sizing: border-box;
				// flex-grow: 1;
				width: 600rpx;
			}

			.to-msg {
				position: relative;
				flex-shrink: 0;
				padding-left: 20rpx;
				color: #999999;
				font-size: 28rpx;
				.close{
					position: absolute;
					top: -10rpx;
					right: -24rpx;
					width: 24rpx;
					height: 24rpx;
					background-color: red;
					border-radius: 50%;
					color: #fff;
					line-height: 24rpx;
					text-align: center;
				}
			}

			.phput {
				// height: 72rpx;
				box-sizing: border-box;
				border-radius: 20px;
				opacity: 1;
				background: #F8F8F8;
				// padding: 0 24rpx;
				// flex-grow: 1;
				flex: 1;
				// margin-left: 20rpx;
				color: #999999;
				font-size: 28rpx;
			}

			.pjyou {
				text-align: center;
				flex-shrink: 0;
				padding: 0 20rpx;

				.pjpic {
					width: 46rpx;
					height: 46rpx;
					margin: 0 auto;
				}

				.pjtxt {
					font-size: 20rpx;
					text-align: center;
					color: #999999;
				}

				.txtactive {
					color: #45C4B0;
				}

			}

			.fatxt {
				font-size: 28rpx;
				font-weight: bold;
				color: #45C4B0;
				padding: 20rpx;
			}
			
			.fa-btn{
				white-space: nowrap;
				width: 50px!important;
				height: 30px;
				line-height: 30px;
				text-align: center;
				border-radius: 94px;
				opacity: 1;
				background: #45C4B0;
				font-size: 28rpx;
				font-weight: bold;
				color: #fff;
				margin-left: 15rpx;
			}
			
			.zan{
				width: 50%;
				justify-content: center;
				color: #999;
				image{
					height: 32rpx;
					width: 32rpx;
					margin-left: 5rpx;
				}
				text,
				view{
					font-size: 12px;
				}
			}
			.line{
				height: 48rpx;
				margin-top: 10rpx;
				width: 1rpx;
				position: absolute;
				left: 50%;
				background: #999;
			}
			.com{
				width: 50%;
				justify-content: center;
				color: #999;
				
				image{
					height: 40rpx;
					width: 40rpx;
					margin-left: 5rpx;
				}
				text,
				view{
					font-size: 12px;
				}
			}
		}

		.mask {
			background: #F2F5F2;
			border-top-left-radius: 8px;
			border-top-right-radius: 8px;
			overflow: hidden;
			box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.302);

			.matop {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 40rpx 68rpx;
				margin-bottom: 20rpx;
				border-bottom: 1px solid rgba(153, 153, 153, 0.1);
				background-color: #ffffff;

				.mapic {
					width: 40rpx;
					height: 40rpx;
					flex-shrink: 0;
				}

				.matxt {
					flex-grow: 1;
					font-size: 28rpx;
					padding: 0 16rpx;
					font-weight: bold;
					letter-spacing: 0em;
					color: #3D3D3D;
				}
			}

			.qubox {
				line-height: 120rpx;
				text-align: center;
				font-size: 28rpx;
				font-weight: bold;
				letter-spacing: 0em;
				color: #3D3D3D;
				height: 120rpx;
				opacity: 1;
				background: #FFFFFF;
			}
		}
	}
	
	.mask11 {
		background-color: #ffffff;
		width: 534rpx;
		border-radius: 8px;
		padding: 20rpx 30rpx;
	
		.matitle {
			font-size: 32rpx;
			font-weight: bold;
			text-align: center;
			letter-spacing: 0em;
			color: #3D3D3D;
			padding-bottom: 6rpx;
			line-height: 46rpx;
		}
	
		.matxt {
			font-size: 24rpx;
			font-weight: normal;
			text-align: center;
			letter-spacing: 0em;
			color: #999999;
			line-height: 34rpx;
			padding-bottom: 50rpx;
		}
	
		.quque {
			display: flex;
			align-items: center;
			border-top: 1px solid rgba(153, 153, 153, 0.1);
	
			.quli {
				width: 50%;
				height: 80rpx;
				line-height: 80rpx;
				text-align: center;
				font-size: 32rpx;
				font-weight: normal;
				letter-spacing: 0em;
				color: #3D3D3D;
			}
	
			.quactive {
				background: rgba(69, 196, 176, 0.05);
			}
		}
	}
</style>